<template>
    <div>
账户:<input type="text" v-model="info.username"/><br/>
密码:<input type="text" v-model="info.userpwd"/><br/>
<input type="button" value="登录" @click="login"/>
    </div>
</template>

<script setup lang="ts">
import { ref,reactive } from 'vue';
//v-model   双向绑定  一般用于表单元素 目的获取表单元素的value值
let info=reactive({
    username:'',
    userpwd:''
})

const login=()=>{
alert(info.username)
}

//v-bind 单项绑定
</script>

<style scoped>

</style>